{include file="public/header" /}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">
                        <div class="layui-inline layui-show-xs-block">
                            <select name="status">
                                <option value="">是否上架</option>
                                <option value="1" {if !empty(input('get.isSale')) &&
                                    input('get.isSale')==1}selected{/if}>上架</option>
                                <option value="2" {if !empty(input('get.status')) &&
                                    input('get.isSale')==2}selected{/if}>下架</option>
                            </select>
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <select name="status">
                                <option value="">是否推荐</option>
                                <option value="1" {if !empty(input('get.isBest')) &&
                                    input('get.isBest')==1}selected{/if}>推荐</option>
                                <option value="2" {if !empty(input('get.isBest')) &&
                                    input('get.isBest')==2}selected{/if}>正常</option>
                            </select>
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <select name="status">
                                <option value="">是否热卖</option>
                                <option value="1" {if !empty(input('get.isHot')) && input('get.isHot')==1}selected{/if}>
                                </option>
                                热卖</option>
                                <option value="2" {if !empty(input('get.isHot')) && input('get.isHot')==2}selected{/if}>
                                    正常</option>
                            </select>
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <select name="status">
                                <option value="">是否新品</option>
                                <option value="1" {if !empty(input('get.isNew')) && input('get.isNew')==1}selected{/if}>
                                    新品</option>
                                <option value="2" {if !empty(input('get.isNew')) && input('get.isNew')==2}selected{/if}>
                                    正常</option>
                            </select>
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="title" placeholder="商品名称|商品编号" value="{:input('get.title')}"
                                autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">搜索</button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-header">
                    <button class="layui-btn layui-btn-normal" onclick="data_edit('添加','goodslist_edit')"><i
                            class="layui-icon">&#xe654;</i>添加</button>&nbsp;
                    共有数据：<strong id="count">{$list->total()}</strong> 条
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>商品编号</th>
                                <th>商品名称</th>
                                <th>商家名称</th>
                                <th>商品图册</th>
                                <th>所属分类</th>
                                <th>是否上架</th>
                                <th>是否推荐</th>
                                <th>是否热销</th>
                                <th>是否新品</th>
                                <th>销量</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $list as $v}
                            <tr>
                                <td>{$v.id|default=''}</td>
                                <td>{$v.goodsSn|default=''}</td>
                                <td>{$v.title|default=''}</td>
                                <td>{$v.shopname|default=''}</td>
                                <td>
                                    <div id="layer-photos" class="layer-photos">
                                        {foreach $v.images as $vs}
                                        <img layer-pid="" layer-src="{$vs|default=''}" src="{$vs|default=''}"
                                            alt="{$title|default=''}">
                                        {/foreach}
                                    </div>
                                </td>
                                <td>{$v.catename|default=''}</td>
                                <td>
                                    {if !empty($v.isSale) && $v.isSale == 1}上架{else/}下架{/if}
                                </td>
                                <td>
                                    {if !empty($v.isBest) && $v.isBest == 1}推荐{else/}正常{/if}
                                </td>
                                <td>
                                    {if !empty($v.isHot) && $v.isHot == 1}热卖{else/}正常{/if}
                                </td>
                                <td>
                                    {if !empty($v.isNew) && $v.isNew == 1}新品{else/}正常{/if}
                                </td>
                                <td>{$v.sale|default=''}</td>
                                <td class="td-manage">
                                    <a title="操作" onclick="data_edit('操作','/shop/goodslist_edit?id={$v.id}')"
                                        href="javascript:;" class="layui-btn layui-btn-normal">
                                        操作
                                    </a>
                                    <a title="删除" onclick="data_del(this,'/shop/goodslist_del','{$v.id}')"
                                        href="javascript:;" class="layui-btn-danger layui-btn">
                                        删除
                                    </a>
                                </td>

                            </tr>
                            {/foreach}

                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body">
                    <div class="page">
                        {$list->render()|raw}
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['form', 'upload'], function () {
        var $ = layui.jquery
            , form = layui.form
            , layer = layui.layer;
    });
</script>
<script>
    layer.photos({
        photos: '#layer-photos'
        , anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
    });
</script>
{include file="public/footer"}